import Http from "@/http"

export function pageApi(params:any) {
    return Http.post('language/page', params)
}

export function saveApi(params:any) {
    return params.id ? Http.put('language/update/' + params.id, params) : Http.post('language/add', params)
}

export function deleteApi(id) {
    return Http.delete('language/delete/' + id)
}

export async function langsApi(locale = '') {
    const res = await Http.get('language/langs', {locale})
    return res.data
}